import { type OrderTyle } from "@/types/consult";
import request from "@/utils/request";

const OrderAPI = {
  /**
   * 通过订单号查询订单数据
   *
   * @param orderID 订单号
   * @returns 获取订单数据
   */
  getOrdersData(orderID: string) {
    return request<OrderTyle | undefined>({
      url: "/order/search/" + orderID,
      method: "GET",
    });
  },
  /**
   * 通过订单号修改订单状态
   *
   * @param orderID 订单号
   * @param stateA 修改后的订单状态
   * @returns 获取订单数据
   */
  changeOrderState(orderID: string, stateA: string) {
    return request<OrderTyle | undefined>({
      url: "/order/put/" + orderID,
      method: "PUT",
      data: { PaymentIsDone: stateA },
    });
  },
};

export default OrderAPI;

export interface KnowledgePageQuery {
  pageNum: number;
  likeFlag: number;
}
